<?
/* Last updated with phpFlickr 1.3.2
 *
 * This example file shows you how to call the 100 most recent public
 * photos.  It parses through them and prints out a link to each of them
 * along with the owner's name.
 *
 * Most of the processing time in this file comes from the 100 calls to
 * flickr.people.getInfo.  Enabling caching will help a whole lot with
 * this as there are many people who post multiple photos at once.
 *
 * Obviously, you'll want to replace the "<api key>" with one provided 
 * by Flickr: http://www.flickr.com/services/api/key.gne
 */

require_once("phpFlickr.php");
$f = new phpFlickr("17d198a5a4093395b3a8162ec30403e1");
//$f->enableCache("db", "mysql://user:password@server/database", "wp_flickr_cache");
$sizes = $f->photos_getSizes();

foreach ($sizes as $size) {
	$max_width = 0;
	$src_thumb = '';
	$src_full = '';
	if ($size['label'] == "Square")
		$src_thumb = $size['source'];
	if (intval($size['width']) > max_width) {
		$src_full = $size['source'];
		max_width = intval($size['width']);
	}
		
	$size['label']
    $owner = $f->people_getInfo($photo['owner']);
    echo "<a href='http://www.flickr.com/photos/" . $photo['owner'] . "/" . $photo['id'] . "/'>";
    echo $photo['title'];
    echo "</a> Owner: ";
    echo "<a href='http://www.flickr.com/people/" . $photo['owner'] . "/'>";
    echo $owner['username'];
    echo "</a><br>";
}
?>
